package controller.user;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import bean.User;
import service.UserService;
import service.impl.UserServiceImpl;


public class Edit extends HttpServlet {
	private static final long serialVersionUID = 1L;

	private UserService userService = new UserServiceImpl();
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String sid = request.getParameter("id");
		User user = userService.queryById(Integer.parseInt(sid));
		request.setAttribute("user", user);		
		String url = "/WEB-INF/jsp/user/edit.jsp";
		request.getRequestDispatcher(url).forward(request, response);
	}

}
